package com.t235.gc.goods.service;

import com.t235.gc.dao.GoodsCategoryDao;
import com.t235.gc.entity.GoodsCategory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsCategoryService {
    @Autowired
    private GoodsCategoryDao goodsCategoryDao;

    public List<GoodsCategory> getGoodsList(String goodsCategoryName) {
        return goodsCategoryDao.getGoodsList(goodsCategoryName);
    }

    public int add(GoodsCategory goodsCategory) {
        return goodsCategoryDao.insert(goodsCategory);
    }

    public int update(GoodsCategory goodsCategory) {
        return goodsCategoryDao.update(goodsCategory);
    }

    public int del(Long goodsCategoryId) {
        return goodsCategoryDao.updateIsDel(goodsCategoryId);
    }
}
